package com.wangwenjun.concurrency.chapter17;

import java.util.concurrent.locks.LockSupport;

/**
 *
 * 1.LockSupport.unpark(thread);
 * 2.LockSupport.park();
 * thread线程不会阻塞
 *
 */
public class TaoBaoTest7 {



    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(() -> {
            LockSupport.park();
            System.out.println("1");
        });
        thread.start();

        new Thread(() -> {
            System.out.println("2");
            LockSupport.unpark(thread);
        }).start();

    }
}
